package lab02.test30;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test30 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Double> numberList = new ArrayList<Double>();

        System.out.println("输入几个成绩：");
        int n = sc.nextInt();
        double sum = 0;

        for(int i = 1;i <= n; i++){

            System.out.println("输入第" + i + "个成绩");

            numberList.add(sc.nextDouble());
        }

        for(Double a : numberList){
            sum += a;
        }

        System.out.println("平均分为:" + sum / n );
    }
}
